using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using LeadTracker.EFCodeFirst.Entities;

namespace LeadTracker.EFCodeFirst.Mapping
{
	public class LeadTypeMap : EntityTypeConfiguration<LeadType>
	{
		public LeadTypeMap()
		{
			// Primary Key
			this.HasKey(t => t.LeadTypeKey);

			// Properties
			this.Property(t => t.LeadTypeKey)
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
				
			this.Property(t => t.LeadType1)
				.IsRequired()
				.HasMaxLength(20);
				
			// Table & Column Mappings
			this.ToTable("LeadType");
			this.Property(t => t.LeadTypeKey).HasColumnName("LeadTypeKey");
			this.Property(t => t.LeadType1).HasColumnName("LeadType");
		}
	}
}

